#pragma once
#include <iostream>
#include <deque>

using namespace std;

namespace Yohifo
{
	
	template<class T, class Container = deque<T>>
	class stack
	{
	public:
		stack(const Container& tmp = Container())
			:_c(tmp)
		{}

		void push(const T& x)
		{
			_c.push_back(x);
		}

		void pop()
		{
			_c.pop_back();
		}

		T& top()
		{
			return _c.back();
		}

		const T& top()const
		{
			return _c.back();
		}

		size_t size()const
		{
			return _c.size();
		}

		bool empty()const
		{
			return _c.empty();
		}

	private:
		Container _c;
	};

	void StackTest1()
	{
		stack<int> s;
		s.push(1);
		s.push(2);
		s.push(3);
		s.push(4);
		s.push(5);

		cout << s.size() << endl;

		while (!s.empty())
		{
			cout << s.top() << " ";
			s.pop();
		}
	}
}